from rest_framework import serializers
from app.models import User,Post

class PostSer(serializers.ModelSerializer):
    user = serializers.StringRelatedField(read_only=True)
    class Meta():
        model = Post
        fields = '__all__'


class UserSer(serializers.ModelSerializer):
    stus = PostSer(source='stu',read_only=True,many=True)
    class Meta():
        model = User
        fields = '__all__'
